﻿namespace MyWebLog.Tests.Logic.Models.Security
{
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using MyWebLog.Logic.Models;
    using MyWebLog.Logic.Models.Security;

    /// <summary>
    /// Unit Tests for the Blog Authorization class
    /// </summary>
    [TestClass]
    public class BlogAuthorizationTest
    {
        /// <summary>
        /// Test the object itself
        /// </summary>
        [TestMethod]
        public void Model()
        {
            var blog = new Blog();
            var user = new BlogUser();
            var permission = new Permission();

            var auth = new BlogAuthorization
            {
                Blog = blog,
                User = user,
                Permission = permission
            };

            Assert.IsNotNull(auth, "The authorization should not have been null");
            Assert.AreSame(blog, auth.Blog, "The Blog was not the same");
            Assert.AreSame(user, auth.User, "The User was not the same");
            Assert.AreSame(permission, auth.Permission, "The Permission was not the same");
        }
    }
}